﻿@model ipFoo.Models.IpAddressModel

@{
    ViewBag.Title = "It's your IP, foo!";
}

@section Head {
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/transitController.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/uiController.js")" type="text/javascript"></script>
}

@* The advanced features section moves around. It will reloate to the top of the page if you error out. Saves on scrolling costs! *@
@if (ViewBag.ValidExecution != null || ViewBag.ResponseBlock != null)
{
    Html.RenderPartial("Advanced", (object)ViewBag.ActionModel);
    
    <hr />
}

<h3>This is the data you were looking for!</h3>
<div class="smallheader">Except for the droids, they aren't here. Sorry.</div>

<div class="row infoSection">
    <div class="span2">IP Address</div>
    <div class="span4">@Model.IpAddress</div>
</div>

<div class="row infoSection">
    <div class="span2">Host Name</div>
    <div class="span4">@Model.HostName</div>
</div>

<div class="row infoSection">
    <div class="span2">User Agent</div>
    <div class="span4 span6">@Model.UserAgent</div>
</div>

<div class="row infoSection">
    <div class="span2">Country</div>
    <div id="geoCountry" class="span4">
        <img src="@Url.Content("~/Content/Images/geoloading.gif")" alt="Geolocation data is loading, please wait." />
    </div>
</div>

<div class="row infoSection">
    <div class="span2">City</div>
    <div id="geoCity" class="span4">
        <img src="@Url.Content("~/Content/Images/geoloading.gif")" alt="Geolocation data is loading, please wait." />
    </div>
</div>

<div class="row">
    <div class="span10">
        <span class="label notice">Hey, listen!</span>
        Is your geolocation data above incorrect? Visit <a href="http://hostip.info" target="_new">hostip.info</a> and let them know!
    </div>
</div>

@* The advanced features section moves around. It will reloate to the top of the page if you error out. Saves on scrolling costs! *@
@if (ViewBag.ValidExecution == null)
{
    <hr />
    
    Html.RenderPartial("Advanced", (object)ViewBag.ActionModel);
}